import React, { useCallback, useState } from "react";
export default function One(props) {
    let [value, setValue] = useState("1")
    let [value1, setValue1] = useState("11")
    function change(e) {
        setValue(e.target.value)
    }
    return (
        <div>
            {/* 1、受控组件，表达可以根据状态改变称为受控组件 */}
            <div>
                <input type="text" onChange={change} value={value}></input>
                <span>{value}</span>
            </div> <br />
            {/* 2、非受控组件,表单不受组件状态控制 */}
            <div>
                <input type="text" defaultValue={value1} />
                <span>{value1}</span>
            </div>
        </div >
    )
}